package com.ambimmort.shj.action.device.td;

import com.ambimmort.shj.service.device.TdDeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by zyt on 2015/7/30.
 */

@Controller("/action/UpdateTddevice.do")
public class UpdateTddevice {
    @Autowired
    private TdDeviceService tdDeviceService;

    @RequestMapping("/action/UpdateTddevice.do")
    @ResponseBody
    public boolean action_device(HttpServletRequest request, @RequestParam("old_ip") String old_ip, @RequestParam("old_user") String old_user,
                                @RequestParam("local_ip") String ip,
                                @RequestParam("local_port") String port,
                                @RequestParam("local_user") String local_user, @RequestParam("local_pswd") String pswd,
                                @RequestParam("freq") String freq, @RequestParam("local_path") String local_path,
                                @RequestParam("desc") String desc, @RequestParam("up2_ip") String up2ip,
                                @RequestParam("up2_port") String up2port, @RequestParam("up2_user") String up2user,
                                @RequestParam("up2_pswd") String up2pswd) {
        return tdDeviceService.updateTddeviceDevice(old_ip, old_user,ip,
                 port, local_user, pswd, freq,
                 local_path, desc, up2ip,
                 up2port, up2user, up2pswd);
    }
}